package com.lzy.managersystem.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lzy.managersystem.mapper.ArticleMapper;
import com.lzy.managersystem.pojo.Article;
import com.lzy.managersystem.service.ArticleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author lzy
 * @description 针对表【article】的数据库操作Service实现
 * @createDate 2022-07-24 15:51:45
 */
@Service
public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article>
        implements ArticleService {

    @Resource
    private ArticleMapper articleMapper;

    @Override
    public List<Article> getAllUser() {
        return articleMapper.selectAll();
    }

    @Override
    public int insterUser(Article article) {
        return articleMapper.insertSelective(article);
    }

    @Override
    public int deleteUser(Integer id) {
        return articleMapper.delById(id);
    }

    @Override
    public int updateUser(Article article) {
        return articleMapper.updateSelective(article);
    }

    @Override
    public int deleteBatchUser(List<Integer> ids) {
        return articleMapper.deleteBatchIds(ids);
    }

    @Override
    public Article getArticleById(Integer id) {
        return articleMapper.selectById(id);
    }
}




